/**
 * Created by zhaoyuan on 15/10/19.
 */


    var oldList = [
    {name : 'Jack','age' : 23},
    {name : 'Tom','age' : 24},
    {name : 'Jane','age' : 21},
    {name : 'Lucy','age' : 23}
];

var newList = [
    {name : 'Jack','age' : 33},
    {name : 'Tom','age' : 34},
    {name : 'Jane','age' : 31},
    {name : 'Lucy','age' : 33}
];

var click = false;


var controllerModule = angular.module("controllerModule",[]);
controllerModule.controller("MyController", function ($scope) {
    $scope.people = {
        list : oldList
    };

    $scope.click = function () {
        click = !click;
        if(click){
            $scope.people = {
                list : newList
            };
        }else{
            $scope.people = {
                list : oldList
            };
        }

    }

});
